package com.drojian.demo1.test6;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;

import com.drojian.demo.R;
import com.drojian.demo1.myself.MyTitleBar;
import com.google.android.material.bottomsheet.BottomSheetDialog;

public class MyAddControlActivity extends AppCompatActivity {
    private MyTitleBar myTitleBar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.ui6_activity_my_add_control);

        myTitleBar= findViewById(R.id.title11);

        myTitleBar.left_onClick(v->finish());
        myTitleBar.setTitle("自定义组合控件");
        myTitleBar.right_onClick(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(MyAddControlActivity.this);
                View dialogView = LayoutInflater.from(MyAddControlActivity.this).inflate(R.layout.bottom_sheet_dialog, null);
                bottomSheetDialog.setContentView(dialogView);
                AppCompatButton button1 = dialogView.findViewById(R.id.bottom_sheet_button_1);
                button1.setOnClickListener(view -> {
                });

                AppCompatButton button2 = dialogView.findViewById(R.id.bottom_sheet_button_2);
                button2.setOnClickListener(view -> {
                });

                AppCompatButton button3 = dialogView.findViewById(R.id.bottom_sheet_button_3);
                button3.setOnClickListener(view -> {
                });

                bottomSheetDialog.show();
            }
        });

    }
}